/**
File Name 	: DateTime.h
Name, NIM	: Muqtafi Akhmad, 23512021
 **/
#ifndef DATE_TIME_H
#define	DATE_TIME_H
#include <string.h>
#include "../Utilities/boolean.h"
#include "../ADTTime/Time.h"
#include "../ADTDate/Date.h"
#include "../ADTCSString/CSString.h"
// Type DateTime : 
// < 
// D : Date;
// T : Time;
// >

typedef struct {
    Date D;
    Time T;
} DateTime;

/**
 * Get date from the given date time
 * @param DT date time
 * @return date
 */
Date GetDate(DateTime DT);
/**
 * Get time from the given date time
 * @param DT date time
 * @param T time
 */
Time GetTime(DateTime DT);
/**
 * Set the date of a given date time
 * @param DT date time
 * @param D date 
 */
void SetDate(DateTime *DT, Date D);
/**
 * Set the time of a given date time
 * @param DT date time
 * @param T time
 */
void SetTime(DateTime *DT, Time T);
/**
 * Returns value wether the inputs are valid to create a date time
 * @param DD day
 * @param MM month
 * @param YY year
 * @param H hour
 * @param M minute
 * @param S second
 * @return is valid
 */
boolean IsValidDateTime(int YY, int MM, int DD, int H, int M, int S);
/**
 * Creates a date time from the given inputs
 * @param DD day
 * @param MM month
 * @param YY year
 * @param H hour
 * @param M minute
 * @param S second
 * @return a date time
 */
DateTime MakeDateTime(int YY, int MM, int DD, int H, int M, int S);
/**
 * Returns true if DT1 < DT2
 * @param DT1 first date time
 * @param DT2 second date time
 * @return DT1 < DT2
 */
boolean DateTimeLessThan(DateTime DT1, DateTime DT2);
/**
 * Returns true if DT1 = DT2
 * @param DT1 first date time
 * @param DT2 second date time
 * @return DT1 = DT2
 */
boolean EqDateTime(DateTime DT1, DateTime DT2);
/**
 * Returns the amount of seconds of a date time since 1 January 2000
 * @param DT date time
 * @return amount of seconds
 */
long long int DateTimeToSecond(DateTime DT);
/**
 * Prints the date time in YYYY-MM-DD HH:MM:SS format
 * @param DT date time
 */
void PrintDateTime(DateTime DT);

/**
 * Parse string input with format YYYY/MM/DD
 * @param input String input
 * @return Date Time 
 */
DateTime ParseDateTime(CSString input);

/**
 * Show date time as string representative
 * @param DT Date Time
 * @return String representative
 */
CSString DateTimeToString(DateTime DT);

#endif

